package com.woniu.controller;

import com.woniu.entity.Result;
import com.woniu.pojo.Role;
import com.woniu.service.IDoctorRoleService;
import com.woniu.vo.RoleVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author doujiao
 * @since 2022-10-11
 */
@RestController
@RequestMapping("/doctorRole")
@Api(tags = "医生角色模块")
public class DoctorRoleController extends BaseController{
    @Resource
    private IDoctorRoleService doctorRoleService;

    /**
     * 根据医生id查询相应的角色
     */
    @GetMapping("/role/{doctorId}")
    @ApiOperation("根据医生id查询相应的角色")
    public Result queryRoleByDoctorId(@PathVariable String doctorId){

        Role role=doctorRoleService.queryRoleByDoctorId(doctorId);
        return toDataResult(role);
    }
}
